﻿<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
  <title>CGU API 9.0102 - Time - strftime</title>
  <link rel="stylesheet" type="text/css" href="reset.css" />
  <link rel="stylesheet" type="text/css" href="main.css" />
</head>

<body>

<div id="head">
  <div id="title">
    <h1>CGU</h1>&nbsp;&nbsp;<h2>Common &amp; General Use JavaScript</h2>
  </div>
</div>

<div id="foot">
  <div id="copy">
    <span>&copy; 2008 CGU</span>
  </div>
</div>

<div id="body">
  <div id="nav">
    <div class="pad">
      
      <div class="navlist">
        <h3>CGU</h3>
        <ul>
          <li><a href="index.html">API Home</a></li>
          <li><a href="functions.html">Functions</a></li>
        </ul>
      </div>

      <div class="navlist">
        <h3>Time</h3>
        <ul>
          <li><a href="functions.fromTime.html">fromTime</a></li>
          <li><a href="functions.local.html">local</a></li>
          <li><a href="functions.phpdate.html">phpdate</a></li>
          <li><a href="functions.phputc.html">phputc</a></li>
          <li class="active"><a href="functions.strftime.html">strftime</a></li>
          <li><a href="functions.strfutc.html">strfutc</a></li>
          <li><a href="functions.toTime.html">toTime</a></li>
          <li><a href="functions.utc.html">utc</a></li>
        </ul>
      </div>

      <div class="navlist">
        <h3>Utilities</h3>
        <ul>
          <li><a href="utilities.Cookie.html">Cookie</a></li>
          <li><a href="utilities.Crypto.html">Crypto</a></li>
          <li><a href="utilities.Iterator.html">Iterator</a></li>
          <li><a href="utilities.JSON.html">JSON</a></li>
          <li><a href="utilities.Query.html">Query</a></li>
          <li><a href="utilities.Time.html">Time</a></li>
          <li><a href="utilities.Type.html">Type</a></li>
        </ul>
      </div>
      
    </div>
  </div>
  
  <div id="docs">
    <div class="pad">
      <div id="content">

<h1 id='CGU-Main'>strftime</h1>

<blockquote>
<p>C/C++ date formatting in local time.</p>
</blockquote>
<hr />
<h3 id='syntax'>Syntax</h3>

<blockquote>
<pre class='prettyprint'><code>CGU.strftime(format [, time])</code></pre>

<blockquote>
<p><strong><code>format</code></strong> <code>&lt;String&gt;</code>: A string representing the date format.</p>

<blockquote>
<p><em>(see below)</em></p>
</blockquote>

<p><strong><code>time</code></strong> <code>&lt;Date&gt;</code>: A date to format.</p>

<blockquote>
<p><code>&lt;Number&gt;</code>: Unix Epoch time in milliseconds.</p>

<p><code>&lt;null&gt;</code>: Use current time.</p>
</blockquote>
</blockquote>
</blockquote>

<h3 id='return'>Return</h3>

<blockquote>
<p><code>&lt;String&gt;</code>: A formatted date string.</p>

<blockquote>
<p><code>&lt;null&gt;</code>: Out of range. <code>(Jan 1, 0000 - Dec 31, 9999)</code></p>

<p><code>&lt;undefined&gt;</code>: Invalid <code>time</code>.</p>
</blockquote>
</blockquote>
<hr />
<h3 id='format'>Format</h3>

<blockquote>
<p><code>%a</code> - Abbreviated week. <code>(Sun - Sat)</code><br /><code>%A</code> - Full week. <code>(Sunday - Saturday)</code><br /><code>%b</code> - Abbreviated month. <code>(Jan - Dec)</code><br /><code>%B</code> - Full month. <code>(January - December)</code><br /><code>%c</code> - Locale date and time. <code>(based on Date#toLocaleString)</code><br /><code>%C</code> - Century. <code>(year / 100)</code><br /><code>%d</code> - Day of the month with leading zeros.<br /><code>%D</code> - Equivalent to <code>&quot;%m/%d/%y&quot;</code>.<br /><code>%e</code> - Day of the month with leading spaces.<br /><code>%E</code> - POSIX locale extensions. <em>(<strong>unsupported</strong>)</em><br /><code>%F</code> - Equivalent to <code>&quot;%Y-%m-%d&quot;</code>.<br /><code>%g</code> - 2-digit year containing majority of the Monday-start week.<br /><code>%G</code> - 4-digit year containing majority of the Monday-start week.<br /><code>%h</code> - <code>%b</code>.<br /><code>%H</code> - Hour of 24-hour clock with leading zeros.<br /><code>%I</code> - Hour of 12-hour clock with leading zeros.<br /><code>%j</code> - Day of the year with leading zeros. <code>(000 - 366)</code><br /><code>%k</code> - Hour of 24-hour clock with leading spaces.<br /><code>%l</code> - Hour of 12-hour clock with leading spaces.<br /><code>%m</code> - Numeric month with leading zeros.<br /><code>%M</code> - Minutes with leading spaces.<br /><code>%n</code> - newline.<br /><code>%N</code> - Milliseconds with leading zeros.<br /><code>%O</code> - POSIX locale extensions. <em>(<strong>unsupported</strong>)</em><br /><code>%p</code> - Uppercase ante meridiem or post meridiem.<br /><code>%P</code> - Lowercase ante meridiem or post meridiem.<br /><code>%r</code> - Equivalent to <code>&quot;%I:%M:%S %p&quot;</code>.<br /><code>%R</code> - Equivalent to <code>&quot;%H:%M&quot;</code>.<br /><code>%s</code> - Seconds since Unix Epoch.<br /><code>%S</code> - Seconds with leading zeros.<br /><code>%t</code> - tab.<br /><code>%T</code> - Equivalent to <code>"%H:%M:%S"</code>.<br /><code>%u</code> - Day of the week. <code>(1 - 7 &lt;=&gt; Mon - Sun)</code><br /><code>%U</code> - Week number of the year, Sunday-start, with leading zeros.<br /><code>%v</code> - Equivalent to <code>&quot;%e-%b-%Y&quot;</code>.<br /><code>%V</code> - Week number of <code>%G</code> year, Monday-start, with leading zeros.<br /><code>%w</code> - Day of the week. <code>(0 - 6 &lt;=&gt; Sun - Sat)</code><br /><code>%W</code> - Week number of the year, Monday-start, with leading zeros.<br /><code>%x</code> - Locale date. <code>(based on Date#toLocaleDateString)</code><br /><code>%X</code> - Locale time. <code>(based on Date#toLocaleTimeString)</code><br /><code>%y</code> - 2-digit year.<br /><code>%Y</code> - 4-digit year.<br /><code>%z</code> - Offset from UTC. <code>(e.g. -0600)</code><br /><code>%Z</code> - Timezone name. <em>(<strong>unsupported</strong>)</em><br /><code>%%</code> - Percent sign.</p>
</blockquote>
<hr />

      </div>
    </div>
  </div>
</div>

  <script type="text/javascript" src="prettify.js"></script>
  <script type="text/javascript" src="main.js"></script>
</body>

</html>
